﻿/*------------------------------------------------------------------------

CXXLTHREAD.HPP v3.1.1

Copyright 楊志賢 CxxlMan, 2008 - 2013
All Rights Reserved

------------------------------------------------------------------------*/
#if !defined(__CXXLTHREAD_HPP_CxxlMan)
#define __CXXLTHREAD_HPP_CxxlMan

#include <SMART_PTR.HPP>

#if defined(_CXXLOBJECT_DLLEXPORT)
#define CXXLOBJECT_DLLEXPORT CXXL_DLLEXPORT
#else
#define CXXLOBJECT_DLLEXPORT CXXL_DLLIMPORT
#endif


namespace CxxlMan
{

// 多執行緒物件執行介面
class IcxxlThread:virtual public cxxlObject
{

public:

  IcxxlThread(ISpirit *spirit = Spirit_Easy)
    :cxxlObject(spirit)
  {
  }

  virtual ~IcxxlThread()
  {
  }

  // 啟動執行緒後的進入點
  virtual void cxxlFASTCALL ThreadStart() = 0;
};

// 負責讓 IcxxlThread 在另一個執行緒中執行，成功回傳 true
extern CXXLOBJECT_DLLEXPORT bool cxxlFASTCALL Thread_Create(const Smart_Ptr<IcxxlThread> &IcxxlThread_Arg);


}   /* namespace CxxlMan */
#endif
